package com.ee.spring;

import org.springframework.web.bind.annotation.*;


@RequestMapping("/hello")//注解，类路径
@RestController
public class HelloController {

    /**
     * 支持所有请求方式
     * @return
     */
    @RequestMapping("/v2")
    public String v2(){
        return "hello Spring Boot v2~";
    }

    /**
     * 支持get请求
     * @return
     */
    @GetMapping("/v6")
//    @RequestMapping(value = "/v3",method = RequestMethod.GET)
    public String v3(){
        return "hello Spring Boot v3~";
    }
    /**
     * 支持post请求
     * @return
     */
    @PostMapping("/v6")
//    @RequestMapping(value = "/v4",method = RequestMethod.POST)
    public String v4(){
        return "hello Spring Boot v4~";
    }

    /**
     * 支持get&post请求
     * @return
     */
    @RequestMapping(value = "/v5", method ={RequestMethod.GET, RequestMethod.POST})
    public String v5(){
        return "hello Spring Boot v5~";
    }
}
